package com.example.springsession.starterautoconfig.filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;

/**
 * 创建LogFilterRegistrationBean 封装LogFilter 成bean
 */

public class LogFilterRegistrationBean extends FilterRegistrationBean<LogFilter> {

    public LogFilterRegistrationBean() {
        super();
        // 添加 LogFilter 过滤器
        this.setFilter(new LogFilter());
        // 匹配所有路径
        this.addUrlPatterns("/*");
        // 定义过滤器名称
        this.setName("LogFilter");
        // 配置优先级
        this.setOrder(1);
    }

}
